package ls.jpa.chapterA.repository;

import ls.jpa.chapterA.domain.Customer;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.querydsl.QueryDslPredicateExecutor;

import javax.transaction.Transactional;
import java.util.List;

/**
 * @author Barudisshu
 */
@Transactional
public interface CustomerRepository extends JpaRepository<Customer,Long>, QueryDslPredicateExecutor {

    Customer findByEmailAddress(String emailAddress);

    // ------------JPA Metamodel-----------------
    public List<Customer> findByFirstName(String firstName);
    public List<Customer> findByLastName(String lastName);

    // ------------Query DSL---------------------
    public List<Customer> findByVersion(Long version);

    // ------------QueryDSL + Spring Data JPA----

}
